package com.ktjy.test;

import com.ktjy.entity.Pet;
import com.ktjy.service.PetService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

public class Main {

    @Test
    public void test1(){
        //1.创建spring上下文对象
        ApplicationContext context=
                new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        //2.获取我们想要对象
        PetService petService = (PetService)context.getBean("petService");

        petService.insert(new Pet());
    }

}
